<template>
    <div >
      <div class="hd">
        <span @click="$router.go(-1)"> 返回 </span>
         资金记录
      </div>
      <div class="ctct">
         <div class="ctitem" v-for="item of ctlist" :key="item.id">
           <div class="acleft">
             <div class="line1">
               <template v-if="item.type==1">充值</template>
               <template v-if="item.type==2">分销收入</template>
               <template v-if="item.type==3">系统奖励</template>
               <template v-if="item.type==4">提现</template>
               <template v-if="item.type==5">订单支出</template>
               <template v-if="item.type==6">其他</template>
             </div>
             <div class="line2">{{ new Date(parseInt(item.add_time)) | moment('YYYY-MM-DD hh:mm:ss')}}</div>
           </div>
           <div class="acright">
             <template v-if="item.inout==1">+</template>
             <template v-else>-</template>
                {{item.fee}}
           </div>

         </div>
      </div>

    </div>
</template>

<script>
export default {
  name: 'Account',
  data () {
    return {
      ctlist: []
    }
  },
  beforeMount: async function () {
    this.getaclist()
  },
  methods: {
    async getaclist () {
      let res = await this.$api.post('/getaclist', {uid: this.$store.state.wxuser.uid})
      if (res.data.state) {
        this.ctlist = res.data.data
      }
    }
  }
}
</script>

<style scoped>
  .br{
    border:1px solid red
  }
  .actop{
    height: 60px;
    padding:30px 20px 20px;
    border-bottom:2px solid #e9e9e9
  }

  .avt{
    height: 60px;
    width: 60px;
    box-sizing: border-box;
    border-radius: 50%;
    position: relative;
  }
  .avt > img{
    width: 100%;
    border-radius: 50%;
  }
  .acname{
    font-weight: 500;
    font-size: 25px;
    color:#666;
  }
  .acname + span{
    font-size: 12px;
    color:#999
  }
.aczone{
  padding:10px 20px
}
  .acitem{
    padding:10px 0px;
    border-bottom:1px solid #e9e9e9;
    color:#666;
    position: relative;
    font-size: 16px;
  }
.acitem span{
  display: block;
  font-size: 12px;
  line-height:20px;
  color:#999
}
  .acitem .fr{
    font-size: 14px;
    padding-top: 10px;
  }
  #qrcode{
    width: 30px;
    height: 30px;
    position: absolute;
    top:50%;
    transform: translateY(-50%);
    left:70px
  }
  .acitem .mr{
    color:orangered;
    font-size: 14px;
  }
  .ctitem{
    padding:10px 0;
    border-bottom:1px solid #dbdbdb;
  }
  .ctitem:after{
    content:'';
    display:block;
    clear: both;

  }
  .ctct{
    padding:10px 15px
  }
  .line1{
    color:#444
  }
  .line2{
    font-size: 12px;
    color:#cccccc;
  }
  .acleft{
    float:left
  }
  .acright{
    float:right;
    padding-top: 10px;
  }
</style>
